<@override name="head">
<title>角色管理</title>
<script type="text/javascript" src="${ctx}/assets/js/lib/bootstrap.min.js"></script>
<script type="text/javascript" src="${ctx}/assets/js/lib/bootbox.js"></script>
<script type="text/javascript" src="${ctx}/assets/js/common/table.js"></script>
<script type="text/javascript" src="${ctx}/assets/js/back/role.js"></script>
</@override>
<@override name="body">
<div id=content_bg>
<#include "/main/home/common.ftl"/>
     <div id= "pagecontent" style="padding-bottom:30px;">
    	<div id="content">
   			<div id="navDiv">
				<ul id="navDiv_ul">
					<li><i class="icon-home"></i></li>
					<li><a href="${ctx}/back/main/dashboard">首页</a></li>
					<li><i class="icon-angle-right"></i></li>
				    <li class="navDiv_currentLi">角色管理</li>
				</ul>  
 			</div>
 			
 			<form id="myform" action="${ctx}/back/main/role/list" method="post">
 				<input type="hidden" id="page" name="page" value="#{pager.page}"/>
 				<div id="navButtons">
					<div id="button" style="margin-bottom:20px;">	
						<a href="${ctx}/back/main/role/add" class="btn2">新建</a>
						<a class="btn2" id="all-btn-enable">批量开启</a>
						<a class="btn2" id="all-btn-disable">批量停用</a>
						<a class="btn2" id="btn-permissions">分配权限</a>
					</div>
				</div>
 				<table border="1" class="tableFig">
 					<thead>
				        <tr class="theadTr">
				        	<th class="theadTh" style="width:5%;"><div class="checkboxStyleTh"></div></th>
							<th class="theadTh" style="width:20%;">角色名</th>
							<th class="theadTh" style="width:10%;">状态</th>
							<th class="theadTh" style="width:20%;">roleKey</th>
							<th class="theadTh" style="width:20%;">描述</th>
							<th class="theadTh" style="width:25%;">操作</th>
				        </tr>
				    </thead>
				    <tbody>
				    	<#if rolesList ??>
		                <#list rolesList as roles>
				        <tr id="tbodyTr">
							<td class="tbodyTd"><div class="checkboxStyleTd" id="${roles.id!}"></div></td>
							<td class="tbodyTd">${roles.name!}</td>
							<td class="tbodyTd"><#if roles.enable=="1">开启<#else>停用</#if></td>
							<td class="tbodyTd">${roles.roleKey!}</td>
							<td class="tbodyTd">${roles.description!}</td>
							<td class="tbodyTd">
								<div id="listButtons">
									<a class="btn3" href='${ctx}/back/main/role/edit?roleId=${roles.id!}'>编辑</a>
									<#if roles.enable=='1'>
							    	<a id="btn-disable" value="${roles.id!}" class="btn3">停用</a>	
									<#elseif roles.enable='0'>
									<a id="btn-enable" value="${roles.id!}" class="btn3">开启</a>
									</#if>
									<a id="btn-delete" value="${roles.id!}" class="btn3">删除</a>
								</div>
							</td>
				        </tr>
				    </tbody>
				     </#list>
						</#if>   
 				</table>
 				<div id="pageDiv" style="margin-top:0px;">
					<#include "/common/pagination/simple.ftl"/>
				</div>
 			</form>
		</div>
	</div>
</div>
</@override>
<@extends name="/common/simple.ftl"/>